OJS.Midi
Class MidiIoController

java.lang.Object
  extended by OJS.Midi.MidiIoController
All Implemented Interfaces:
javax.sound.midi.Receiver

public class MidiIoController
extends java.lang.Object
implements javax.sound.midi.Receiver

Author:
shengz This class is the high level module which connects the input and output modules. Other modules can access midi devices through this module.

Constructor Summary
MidiIoController()
          Two transmitters are used to transmit input messages to output device and network buffer, respectively.
 
Method Summary
 void close()
           
static void listDevices()
          Enumerate all the midi devices and print to console.
 void noteTest()
          Send a note on and a note off messages to the output device.
 void play(javax.sound.midi.ShortMessage message, long t)
          Send a message to output device.
 void send(javax.sound.midi.MidiMessage message, long t)
          Send the midi message to the network buffer.
 void sendSnapShot(MidiSnapShot s)
          Send all the notes in a MidiSnapShot to output device with their delay values
 void setNetwork(Network n)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MidiIoController

public MidiIoController()
Two transmitters are used to transmit input messages to output device and network buffer, respectively.

Method Detail

noteTest

public void noteTest()
Send a note on and a note off messages to the output device.


listDevices

public static void listDevices()
Enumerate all the midi devices and print to console.


sendSnapShot

public void sendSnapShot(MidiSnapShot s)
Send all the notes in a MidiSnapShot to output device with their delay values

Parameters:
s - - MidiSnapShot data, stores notes and their delays

play

public void play(javax.sound.midi.ShortMessage message,
                 long t)
Send a message to output device. Messege's channel is over written to the local channel value.

Parameters:
- - message to be sent
t - - delay in miliseconds before the message is executed

setNetwork

public void setNetwork(Network n)
Parameters:
n - - network object to receiver messages

close

public void close()
Specified by:
close in interface javax.sound.midi.Receiver

send

public void send(javax.sound.midi.MidiMessage message,
                 long t)
Send the midi message to the network buffer. Messege's channel is over written to the local channel value.

Specified by:
send in interface javax.sound.midi.Receiver
See Also:
Receiver.send(javax.sound.midi.MidiMessage, long)